package com.feini.ktv.svc.controller.pm;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.feini.ktv.svc.entity.pm.PmSeller;
import com.feini.ktv.svc.service.pm.IPmSellerService;
import com.podara.skeleton.controller.SkeletonController;
import com.podara.skeleton.log.annotation.LogLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jiangzr
 * @since 2021-04-17
 */
@LogLogger
@RestController
public class PmSellerController implements SkeletonController {
    @Autowired
    private IPmSellerService sellerService;

    @GetMapping("/querySellerFindaAll")
    public List<PmSeller> querySellerFindaAll() {
        QueryWrapper<PmSeller> sellerQueryWrapper = new QueryWrapper<PmSeller>();
        sellerQueryWrapper.eq("remark", "测试数据");//该表需要加一个状态:status
        List<PmSeller> sellers = this.sellerService.list(sellerQueryWrapper);
        return sellers;
    }

    @GetMapping("/querySellerLikeName/{enterpriseName}")
    public List<PmSeller> querySellerLikeName(@PathVariable("enterpriseName") String enterpriseName) {
        QueryWrapper<PmSeller> sellerQueryWrapper = new QueryWrapper<PmSeller>();
        sellerQueryWrapper.like("enterprise_name", enterpriseName);
        List<PmSeller> sellers = this.sellerService.list(sellerQueryWrapper);
        return sellers;
    }
}

